var $ = layui.$;
var form = layui.form
var layer = layui.layer;
layui.use(['form','layer'], function(){
    $ = layui.$;
    form = layui.form
    layer = layui.layer;
    form.render("checkbox");
    //filter并非必须
    form.on('checkbox', function(data){

        var userId=$("input[name=userId]").val();

        var value=data.value;
        var checked=data.elem.checked
        $.ajax({
            url:"/personnel/addRoleData",
            type:"post",
            dataType:"json",
            data : {"value":value,"boo":checked,"userId":userId},
            success:function(item) {
                layer.msg("操作成功",{icon:1});
            }
        })

    });

});